package com.example.eureka.service.department.web;

import com.example.eureka.service.department.domain.Department;
import com.example.eureka.service.department.service.DepartmentService;
import com.example.eureka.service.department.utility.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/departments")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/{id}")
    public ResultMessage<Department> getDepartment(@PathVariable("id") Long id) {
        Department department = departmentService.getDepartment(id);

        return new ResultMessage<>(10000L, "success", department);
    }

}
